package internal

import (
	"common/pkg/rabbitmq"
	"github.com/zouyx/agollo/v3/component/log"
)

func consumer() {
	replace := func(sql string) {
		err := db.Exec(sql).Error
		if err != nil {
			log.Info("replace error: %s\n", sql)
		}
	}

	mq := rabbitmq.NewRabbitMQSimple("douyin")
	mq.ConsumeSimple(replace)
}

func init() {
	go consumer()
}
